Once the dialog box has been created, you must process the events sent to it using an event loop. You repeatedly call WaitNextEvent and pass the events returned through the function "QTIsStandardParameterDialogEvent" .
The QTIsStandardParameterDialogEvent function checks each event to see if it relates to the standard parameters dialog box. You should continue to handle events that are not related to the standard parameters dialog box as usual.
Warning
You should not use the
ModalDialog
function to process events for a standard parameters dialog box. The
ModalDialog
function is not guaranteed to work correctly in all circumstances with a standard parameters dialog box.
You pass the event record returned from WaitNextEvent to the function QTIsStandardParameterDialogEvent , then check the return value to find out how the events was handled. Common return values are
The QTIsStandardParameterDialogEvent function may also return error codes, such as memory errors.
Your application should only process the event returned from WaitNextEvent if QTIsStandardParameterDialogEvent returns an error or featureUnsupported .
The code in Listing 5 is an example event loop showing how QTIsStandardParameterDialogEvent is used.
Listing 5 An example event loop showing use of QTIsStandardParameterDialogEvent
while (result == noErr)
{
EventRecord theEvent;
WaitNextEvent(everyEvent, &theEvent, 0, nil);
result = QTIsStandardParameterDialogEvent(&theEvent,
createdDialogID);
switch (result)
{
case featureUnsupported:
{
result = noErr;
switch (theEvent.what)
{
case updateEvt:
BeginUpdate((WindowPtr) theEvent.message);
EndUpdate((WindowPtr) theEvent.message);
break;
}
break;
}
case codecParameterDialogConfirm:
case userCanceledErr:
QTDismissStandardParameterDialog(createdDialogID);
createdDialogID = nil;
break;
}
}
}
| Previous | Chapter Contents | Chapter Top | Next |